<?php
class General {
    /**
     * Lớp này đưa ra các dữ liệu dùng chung trên toàn website
     */
   public function slides($type=1) {
     $arr = db_array('SELECT *
                     FROM slides
                     WHERE sli_type = '.$type.'
                     ORDER BY sli_order ASC
                     LIMIT 8');
     return $arr;
   }
   public function home_products() {
      $arr = db_array('SELECT pro_id,pro_name,pro_alias,pro_image,pro_type,pro_price,pro_instock_status,pro_promotion,
                              pro_display_standard,pro_display_width,pro_general_os,pro_cpuram_core,pro_cpuram_speed,
                              pro_cpuram_ram,pro_cam_primary,pro_connect_duasim,pro_pin_capacity
                       FROM products
                       WHERE pro_active = 1 AND pro_showhome > 0
                       ORDER BY pro_showhome ASC
                       LIMIT 20');
      return $arr;
   }
   public function home_accessories() {
      $arr = db_array('SELECT *
                       FROM accessories
                       WHERE acc_active = 1 AND acc_showhome > 0
                       ORDER BY acc_showhome ASC
                       LIMIT 4');
      return $arr;
   }
}
?>